package com.booter.gateway.filter;

import org.springframework.cloud.gateway.filter.factory.rewrite.RewriteFunction;

import java.util.Map;

public  class Config {

        private Class inClass;

        private Class outClass;

        private String contentType;

        @Deprecated
        private Map<String, Object> inHints;

        @Deprecated
        private Map<String, Object> outHints;

        private RewriteFunction rewriteFunction;

        public Class getInClass() {
            return inClass;
        }

        public Config setInClass(Class inClass) {
            this.inClass = inClass;
            return this;
        }

        public Class getOutClass() {
            return outClass;
        }

        public Config setOutClass(Class outClass) {
            this.outClass = outClass;
            return this;
        }

        @Deprecated
        public Map<String, Object> getInHints() {
            return inHints;
        }

        @Deprecated
        public Config setInHints(Map<String, Object> inHints) {
            this.inHints = inHints;
            return this;
        }

        @Deprecated
        public Map<String, Object> getOutHints() {
            return outHints;
        }

        @Deprecated
        public Config setOutHints(Map<String, Object> outHints) {
            this.outHints = outHints;
            return this;
        }

        public RewriteFunction getRewriteFunction() {
            return rewriteFunction;
        }

        public Config setRewriteFunction(RewriteFunction rewriteFunction) {
            this.rewriteFunction = rewriteFunction;
            return this;
        }

        public <T, R> Config setRewriteFunction(Class<T> inClass, Class<R> outClass,
                                                                                      RewriteFunction<T, R> rewriteFunction) {
            setInClass(inClass);
            setOutClass(outClass);
            setRewriteFunction(rewriteFunction);
            return this;
        }

        public String getContentType() {
            return contentType;
        }

        public Config setContentType(String contentType) {
            this.contentType = contentType;
            return this;
        }

    }